<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // class
        class Person {
            // name;
            // age;

            // 构造方法
            constructor(name, age) {
                this.name = name
                this.age = age
            }

            // 方法
            // 不支持ES5的方法声明
            run() {
                console.log('run...');
            }
        }

        let p = new Person('js', 19)
        console.log(p)
        p.run()
    </script>
</body>
</html>